<template>
  <div class="surefahuo_page">
    <div class="sure_top">
      <div class="img" @click="back">
        <img :src="require('../../assets/images/order/fanhui.png')" alt="" />
      </div>
    </div>

    <ul class="ul_top">
      <li>
        <p>客户</p>
        <p>{{info.cusName}}</p>
      </li>

      <li>
        <p>商品</p>
        <p>{{info.prodName}}</p>
      </li>
      <li>
        <p>数量</p>
        <p>{{info.prodNum}}</p>
      </li>
      <li>
        <p>下单人</p>
        <p>{{info.orderUserName}}</p>
      </li>
      <li>
        <p>下单时间</p>
        <p>{{info.orderTime}}</p>
      </li>
    </ul>

    <ul class="ul_down">
      <li>
        <p>收货人</p>
        <p><input type="text" v-model="receiver" /></p>
      </li>

      <li>
        <p>联系电话</p>
        <p><input type="text" v-model="linkPhone"/></p>
      </li>
      <li>
        <p>收货地址</p>
        <p><textarea v-model="address"></textarea></p>
      </li>
      <li>
        <p>物流单号</p>
        <p><input type="text" v-model="logisticsCode"/></p>
      </li>
    </ul>

    <div class="foot">
      <div class="btn" @click="sureSend">
        <p>确认发货消息</p>
      </div>
    </div>
  </div>
</template>

<script>
import {DetailApi,SendApi} from '../../request/api'
export default {
  data(){
    return {
      info:{},
      receiver:'',
      linkPhone:'',
      address:'',
      logisticsCode:'',
    }
  },
  created(){
    //  let token = localStorage.getItem("token");
    let serialNo = this.$route.params.serialNo
    DetailApi(
      serialNo
    ).then(res=>{
      // console.log(res);
      this.info = res.data;
      console.log(this.info);
    })
  },
  methods: {
    back() {
      this.$router.back();
    },
     sureSend(){
      let serialNo = this.$route.params.serialNo
      console.log(1);
      SendApi({  
        serialNo:serialNo,
        receiver:this.receiver,
        linkPhone:this.linkPhone,
        address:this.address,
        logisticsCode:this.logisticsCode}
      ).then(res=>{
        console.log(res);
        if(res.errCode == 0){
          this.$toast.success('发货成功');
        }    
      })
    }
  },
};
</script>

<style lang="less" scoped>
.surefahuo_page {
    width: 100vw;
    height: 100vh;
  background-color: #f5f5f5;
}
.sure_top {
  width: 100%;
  height: 41px;
  background-color: #039;
  display: flex;
  align-items: center;
  margin-bottom: 10px;
  img {
  width: 20px;
    height: 20px;
    padding-left: 10px;
    box-sizing: border-box;
  }
}
.ul_top {
  width: 100%;
  // height: 221px;
  background-color: #fff;
  margin-bottom: 10px;
  li {
    display: flex;
    justify-content: space-between;
    padding: 15px;
    border-bottom: 1px solid #ccc;
    p {
      &:nth-of-type(2) {
        color: #989898;
      }
    }
  }
}

.ul_down {
  background-color: #fff;
//   padding-bottom: 88px;
  li {
    display: flex;
    align-items: center;
    // justify-content: space-between;
    padding: 10px 15px;
    // border-bottom: 1px solid #ccc;
    p {
      width: 25%;
    }
    input {
      width: 260px;
      outline: none;
      background-color: #f5f5f5;
      border: 0;
      padding: 10px;
      box-sizing: border-box;
      color: #989898;
    }
    textarea {
        height: 50px;
          width: 260px;
        background-color: #f5f5f5;
      border: 0;
      color: #989898;
    }
  }
}

.foot {
  width: 100%;
  height: 88px;
  background-color: #fff;
  position: fixed;
  left: 0;
  bottom: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  .btn {
    width: 347px;
    height: 44px;
    background-color: #039;
    border-radius: 22px;
    line-height: 44px;
    text-align: center;
    color: #fff;
  }
}
</style>